package com.huitu.whht.base.core.api.wq.awqmd;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;
import com.huitu.whht.api.core.common.util.LocalDateTimeUtil;
import java.time.LocalDateTime;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdD;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdDKey;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdDQo;
import com.huitu.whht.base.core.api.wq.awqmd.service.IWqAwqmdDService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 测站水质自动监测数据表API,表名称: WQ_AWQMD_D <br/>
 * 日期: 2019-04-11
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wq/awqmd/d")
public class WqAwqmdDResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WqAwqmdDResource.class);

    private static final String UUID = "5f21c9f1-4db1-4339-a23c-1c93fe02dbc7";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWqAwqmdDService wqAwqmdDService;

    /**
     * @api {get} wq/awqmd/d/{stcd:\\w{8}}/{spt} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/60180671/2015-05-02 00:00:00
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {Date}           spt                采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Double}         wt                 水温
     * @apiSuccess {Double}         ph                 pH值
     * @apiSuccess {Integer}        cond               电导率
     * @apiSuccess {Integer}        turb               浊度
     * @apiSuccess {Double}         dox                溶解氧
     * @apiSuccess {Double}         codmn              高锰酸盐指数
     * @apiSuccess {Double}         codcr              化学需氧量
     * @apiSuccess {Double}         tn                 总氮
     * @apiSuccess {Double}         nh3n               氨氮
     * @apiSuccess {Double}         no2                亚硝酸盐氮
     * @apiSuccess {Double}         no3                硝酸盐氮
     * @apiSuccess {Double}         tp                 总磷
     * @apiSuccess {Double}         toc                总有机碳
     * @apiSuccess {Double}         vlph               挥发酚
     * @apiSuccess {Double}         chla               叶绿素a
     * @apiSuccess {Double}         f                  氟化物
     * @apiSuccess {Double}         ars                砷
     * @apiSuccess {Double}         hg                 汞
     * @apiSuccess {Double}         cr6                六价铬
     * @apiSuccess {Double}         cu                 铜
     * @apiSuccess {Double}         pb                 铅
     * @apiSuccess {Double}         cd                 镉
     * @apiSuccess {Double}         zn                 锌
     * @apiSuccess {Double}         sb                 锑
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{stcd:\\w{8}}/{spt}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("stcd") String stcd,@PathParam("spt") String spt) {
        WqAwqmdDKey pk = new WqAwqmdDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        LOGGER.info("根据主键查询 测站水质自动监测数据表,参数 pk:{}", pk);
        return Response.ok(ApiResultBuilder.create(this, wqAwqmdDService.selectByPrimaryKey(pk))).build();
    }

    /**
     * @api {post} wq/awqmd/d/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)select by filter
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/list
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {List(Double)}   wtList             (数组)水温
     * @apiParam   {List(Double)}   phList             (数组)pH值
     * @apiParam   {Integer}        condMin            (最小)电导率
     * @apiParam   {Integer}        condMax            (最大)电导率
     * @apiParam   {List(Integer)}  turbList           (数组)浊度
     * @apiParam   {List(Double)}   doxList            (数组)溶解氧
     * @apiParam   {Double}         codmnMin           (最小)高锰酸盐指数
     * @apiParam   {Double}         codmnMax           (最大)高锰酸盐指数
     * @apiParam   {Double}         codcrMin           (最小)化学需氧量
     * @apiParam   {Double}         codcrMax           (最大)化学需氧量
     * @apiParam   {Double}         tnMin              (最小)总氮
     * @apiParam   {Double}         tnMax              (最大)总氮
     * @apiParam   {Double}         nh3nMin            (最小)氨氮
     * @apiParam   {Double}         nh3nMax            (最大)氨氮
     * @apiParam   {Double}         no2Min             (最小)亚硝酸盐氮
     * @apiParam   {Double}         no2Max             (最大)亚硝酸盐氮
     * @apiParam   {Double}         no3Min             (最小)硝酸盐氮
     * @apiParam   {Double}         no3Max             (最大)硝酸盐氮
     * @apiParam   {Double}         tpMin              (最小)总磷
     * @apiParam   {Double}         tpMax              (最大)总磷
     * @apiParam   {List(Double)}   tocList            (数组)总有机碳
     * @apiParam   {Double}         vlphMin            (最小)挥发酚
     * @apiParam   {Double}         vlphMax            (最大)挥发酚
     * @apiParam   {Double}         chlaMin            (最小)叶绿素a
     * @apiParam   {Double}         chlaMax            (最大)叶绿素a
     * @apiParam   {Double}         fMin               (最小)氟化物
     * @apiParam   {Double}         fMax               (最大)氟化物
     * @apiParam   {Double}         arsMin             (最小)砷
     * @apiParam   {Double}         arsMax             (最大)砷
     * @apiParam   {Double}         hgMin              (最小)汞
     * @apiParam   {Double}         hgMax              (最大)汞
     * @apiParam   {Double}         cr6Min             (最小)六价铬
     * @apiParam   {Double}         cr6Max             (最大)六价铬
     * @apiParam   {Double}         cuMin              (最小)铜
     * @apiParam   {Double}         cuMax              (最大)铜
     * @apiParam   {Double}         pbMin              (最小)铅
     * @apiParam   {Double}         pbMax              (最大)铅
     * @apiParam   {Double}         cdMin              (最小)镉
     * @apiParam   {Double}         cdMax              (最大)镉
     * @apiParam   {Double}         znMin              (最小)锌
     * @apiParam   {Double}         znMax              (最大)锌
     * @apiParam   {Double}         sbMin              (最小)锑
     * @apiParam   {Double}         sbMax              (最大)锑
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {Date}           spt                采样时间
     * @apiSuccess {Double}         wt                 水温
     * @apiSuccess {Double}         ph                 pH值
     * @apiSuccess {Integer}        cond               电导率
     * @apiSuccess {Integer}        turb               浊度
     * @apiSuccess {Double}         dox                溶解氧
     * @apiSuccess {Double}         codmn              高锰酸盐指数
     * @apiSuccess {Double}         codcr              化学需氧量
     * @apiSuccess {Double}         tn                 总氮
     * @apiSuccess {Double}         nh3n               氨氮
     * @apiSuccess {Double}         no2                亚硝酸盐氮
     * @apiSuccess {Double}         no3                硝酸盐氮
     * @apiSuccess {Double}         tp                 总磷
     * @apiSuccess {Double}         toc                总有机碳
     * @apiSuccess {Double}         vlph               挥发酚
     * @apiSuccess {Double}         chla               叶绿素a
     * @apiSuccess {Double}         f                  氟化物
     * @apiSuccess {Double}         ars                砷
     * @apiSuccess {Double}         hg                 汞
     * @apiSuccess {Double}         cr6                六价铬
     * @apiSuccess {Double}         cu                 铜
     * @apiSuccess {Double}         pb                 铅
     * @apiSuccess {Double}         cd                 镉
     * @apiSuccess {Double}         zn                 锌
     * @apiSuccess {Double}         sb                 锑
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {Date}           testComTm          化验完成时间
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WqAwqmdDQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 测站水质自动监测数据表,参数 WqAwqmdDQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wqAwqmdDService.selectList(filter))).build();
    }

    /**
     * @api {put} wq/awqmd/d [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)add data
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         dox                溶解氧
     * @apiParam   {Double}         codmn              高锰酸盐指数
     * @apiParam   {Double}         codcr              化学需氧量
     * @apiParam   {Double}         tn                 总氮
     * @apiParam   {Double}         nh3n               氨氮
     * @apiParam   {Double}         no2                亚硝酸盐氮
     * @apiParam   {Double}         no3                硝酸盐氮
     * @apiParam   {Double}         tp                 总磷
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         vlph               挥发酚
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {Double}         f                  氟化物
     * @apiParam   {Double}         ars                砷
     * @apiParam   {Double}         hg                 汞
     * @apiParam   {Double}         cr6                六价铬
     * @apiParam   {Double}         cu                 铜
     * @apiParam   {Double}         pb                 铅
     * @apiParam   {Double}         cd                 镉
     * @apiParam   {Double}         zn                 锌
     * @apiParam   {Double}         sb                 锑
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/awqmd/d
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "60180671",
     *   "spt": "2015-05-02 00:00:00.0"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "60180671",
     *   "spt": "2015-05-02 00:00:00.0"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WqAwqmdD record) {
        LOGGER.info("新增 测站水质自动监测数据表,参数 WqAwqmdD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqAwqmdDService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wq/awqmd/d/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         dox                溶解氧
     * @apiParam   {Double}         codmn              高锰酸盐指数
     * @apiParam   {Double}         codcr              化学需氧量
     * @apiParam   {Double}         tn                 总氮
     * @apiParam   {Double}         nh3n               氨氮
     * @apiParam   {Double}         no2                亚硝酸盐氮
     * @apiParam   {Double}         no3                硝酸盐氮
     * @apiParam   {Double}         tp                 总磷
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         vlph               挥发酚
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {Double}         f                  氟化物
     * @apiParam   {Double}         ars                砷
     * @apiParam   {Double}         hg                 汞
     * @apiParam   {Double}         cr6                六价铬
     * @apiParam   {Double}         cu                 铜
     * @apiParam   {Double}         pb                 铅
     * @apiParam   {Double}         cd                 镉
     * @apiParam   {Double}         zn                 锌
     * @apiParam   {Double}         sb                 锑
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/awqmd/d/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "60180671",
     *   "spt": "2015-05-02 00:00:00.0"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "60180671",
     *   "spt": "2015-05-02 00:00:00.0"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WqAwqmdD> recordList) {
        LOGGER.info("批量新增 测站水质自动监测数据表,参数 WqAwqmdD:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqAwqmdDService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wq/awqmd/d/{stcd:\\w{8}}/{spt}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)update data
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         dox                溶解氧
     * @apiParam   {Double}         codmn              高锰酸盐指数
     * @apiParam   {Double}         codcr              化学需氧量
     * @apiParam   {Double}         tn                 总氮
     * @apiParam   {Double}         nh3n               氨氮
     * @apiParam   {Double}         no2                亚硝酸盐氮
     * @apiParam   {Double}         no3                硝酸盐氮
     * @apiParam   {Double}         tp                 总磷
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         vlph               挥发酚
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {Double}         f                  氟化物
     * @apiParam   {Double}         ars                砷
     * @apiParam   {Double}         hg                 汞
     * @apiParam   {Double}         cr6                六价铬
     * @apiParam   {Double}         cu                 铜
     * @apiParam   {Double}         pb                 铅
     * @apiParam   {Double}         cd                 镉
     * @apiParam   {Double}         zn                 锌
     * @apiParam   {Double}         sb                 锑
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 【必须】时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/awqmd/d/60180671/2015-05-02 00:00:00/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("stcd") String stcd,@PathParam("spt") String spt, WqAwqmdD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        LOGGER.info("根据主键修改 测站水质自动监测数据表,参数 WqAwqmdD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wq/awqmd/d/{stcd:\\w{8}}/{spt}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_AWQMD_D(测站水质自动监测数据表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         dox                溶解氧
     * @apiParam   {Double}         codmn              高锰酸盐指数
     * @apiParam   {Double}         codcr              化学需氧量
     * @apiParam   {Double}         tn                 总氮
     * @apiParam   {Double}         nh3n               氨氮
     * @apiParam   {Double}         no2                亚硝酸盐氮
     * @apiParam   {Double}         no3                硝酸盐氮
     * @apiParam   {Double}         tp                 总磷
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         vlph               挥发酚
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {Double}         f                  氟化物
     * @apiParam   {Double}         ars                砷
     * @apiParam   {Double}         hg                 汞
     * @apiParam   {Double}         cr6                六价铬
     * @apiParam   {Double}         cu                 铜
     * @apiParam   {Double}         pb                 铅
     * @apiParam   {Double}         cd                 镉
     * @apiParam   {Double}         zn                 锌
     * @apiParam   {Double}         sb                 锑
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/awqmd/d/60180671/2015-05-02 00:00:00/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("stcd") String stcd,@PathParam("spt") String spt, WqAwqmdD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        LOGGER.info("根据主键修改(只修改非null字段) 测站水质自动监测数据表,参数 WqAwqmdD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wq/awqmd/d/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改WQ_AWQMD_D(测站水质自动监测数据表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         wt                 水温
     * @apiParam   {Double}         ph                 pH值
     * @apiParam   {Integer}        cond               电导率
     * @apiParam   {Integer}        turb               浊度
     * @apiParam   {Double}         dox                溶解氧
     * @apiParam   {Double}         codmn              高锰酸盐指数
     * @apiParam   {Double}         codcr              化学需氧量
     * @apiParam   {Double}         tn                 总氮
     * @apiParam   {Double}         nh3n               氨氮
     * @apiParam   {Double}         no2                亚硝酸盐氮
     * @apiParam   {Double}         no3                硝酸盐氮
     * @apiParam   {Double}         tp                 总磷
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         vlph               挥发酚
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {Double}         f                  氟化物
     * @apiParam   {Double}         ars                砷
     * @apiParam   {Double}         hg                 汞
     * @apiParam   {Double}         cr6                六价铬
     * @apiParam   {Double}         cu                 铜
     * @apiParam   {Double}         pb                 铅
     * @apiParam   {Double}         cd                 镉
     * @apiParam   {Double}         zn                 锌
     * @apiParam   {Double}         sb                 锑
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wq/awqmd/d/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "60180671",
     * "spt": "2015-05-02 00:00:00.0",
     * "wt": 21.4,
     * "ph": 7.79,
     * "cond": 350,
     * "turb": 8,
     * "dox": 7.52,
     * "codmn": 2.3,
     * "codcr": null,
     * "tn": null,
     * "nh3n": 0.15,
     * "no2": null,
     * "no3": null,
     * "tp": null,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2015-05-13 17:59:56.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WqAwqmdD> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 测站水质自动监测数据表,参数 WqAwqmdD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wq/awqmd/d/{stcd:\\w{8}}/{spt} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/60180671/2015-05-02 00:00:00
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{stcd:\\w{8}}/{spt}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("stcd") String stcd,@PathParam("spt") String spt) {
         WqAwqmdDKey pk = new WqAwqmdDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        LOGGER.info("根据主键删除 测站水质自动监测数据表,参数 pk:{}", pk);
        Integer rows = wqAwqmdDService.deleteByPrimaryKey(pk);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wq/awqmd/d/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除WQ_AWQMD_D(测站水质自动监测数据表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WQ_AWQMD_D-测站水质自动监测数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/by-filter
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {List(Double)}   wtList             (数组)水温
     * @apiParam   {List(Double)}   phList             (数组)pH值
     * @apiParam   {Integer}        condMin            (最小)电导率
     * @apiParam   {Integer}        condMax            (最大)电导率
     * @apiParam   {List(Integer)}  turbList           (数组)浊度
     * @apiParam   {List(Double)}   doxList            (数组)溶解氧
     * @apiParam   {Double}         codmnMin           (最小)高锰酸盐指数
     * @apiParam   {Double}         codmnMax           (最大)高锰酸盐指数
     * @apiParam   {Double}         codcrMin           (最小)化学需氧量
     * @apiParam   {Double}         codcrMax           (最大)化学需氧量
     * @apiParam   {Double}         tnMin              (最小)总氮
     * @apiParam   {Double}         tnMax              (最大)总氮
     * @apiParam   {Double}         nh3nMin            (最小)氨氮
     * @apiParam   {Double}         nh3nMax            (最大)氨氮
     * @apiParam   {Double}         no2Min             (最小)亚硝酸盐氮
     * @apiParam   {Double}         no2Max             (最大)亚硝酸盐氮
     * @apiParam   {Double}         no3Min             (最小)硝酸盐氮
     * @apiParam   {Double}         no3Max             (最大)硝酸盐氮
     * @apiParam   {Double}         tpMin              (最小)总磷
     * @apiParam   {Double}         tpMax              (最大)总磷
     * @apiParam   {List(Double)}   tocList            (数组)总有机碳
     * @apiParam   {Double}         vlphMin            (最小)挥发酚
     * @apiParam   {Double}         vlphMax            (最大)挥发酚
     * @apiParam   {Double}         chlaMin            (最小)叶绿素a
     * @apiParam   {Double}         chlaMax            (最大)叶绿素a
     * @apiParam   {Double}         fMin               (最小)氟化物
     * @apiParam   {Double}         fMax               (最大)氟化物
     * @apiParam   {Double}         arsMin             (最小)砷
     * @apiParam   {Double}         arsMax             (最大)砷
     * @apiParam   {Double}         hgMin              (最小)汞
     * @apiParam   {Double}         hgMax              (最大)汞
     * @apiParam   {Double}         cr6Min             (最小)六价铬
     * @apiParam   {Double}         cr6Max             (最大)六价铬
     * @apiParam   {Double}         cuMin              (最小)铜
     * @apiParam   {Double}         cuMax              (最大)铜
     * @apiParam   {Double}         pbMin              (最小)铅
     * @apiParam   {Double}         pbMax              (最大)铅
     * @apiParam   {Double}         cdMin              (最小)镉
     * @apiParam   {Double}         cdMax              (最大)镉
     * @apiParam   {Double}         znMin              (最小)锌
     * @apiParam   {Double}         znMax              (最大)锌
     * @apiParam   {Double}         sbMin              (最小)锑
     * @apiParam   {Double}         sbMax              (最大)锑
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WqAwqmdDQo filter) {
        LOGGER.info("根据条件删除 测站水质自动监测数据表,参数 WqAwqmdDQo:{}", filter);
        Integer rows = wqAwqmdDService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
